InĀ [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from PlateAnalysis_Echo import PlateDataset
from tqdm import tqdm

dataset_0 = PlateDataset('20191105_Dopt_2.CSV','D_Opt.csv')
dataset_1 = PlateDataset('20191105_Dopt_2_Shaking.CSV','D_Opt.csv')
dataset_2 = PlateDataset('20191105_Dopt_2_Shaking_rep2.CSV','D_Opt.csv')
dataset_3 = PlateDataset('20191105_Dopt_2_Shaking_rep3.CSV','D_Opt.csv')


output =  pd.DataFrame([],columns = [ 'K','percentDMSO', 'Vol','km', 'vmax', 'loss', 'r_squared'])
for i in tqdm(range(1,19)):
    output=output.append(dataset_1.CalculateMetrics(i))
    output=output.append(dataset_2.CalculateMetrics(i))
    output=output.append(dataset_3.CalculateMetrics(i))
    
output = output.reset_index(drop=True)
output.to_csv('DOptExperimnentResults.csv')
output
100%|ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ| 18/18 [00:42<00:00,  2.29s/it]
Out[1]:
K percentDMSO Vol km vmax loss r_squared
0 1.000000 5.000000 20.0 2.675369 0.047003 0.012980 0.328103
1 1.000000 5.000000 20.0 2.227608 0.027246 0.007528 0.517799
2 1.000000 5.000000 20.0 2.581205 0.045789 0.015981 0.368032
3 2.636364 3.181818 20.0 2.475195 0.031945 0.005781 0.691983
4 2.636364 3.181818 20.0 2.109391 0.039754 0.003395 0.885325
5 2.636364 3.181818 20.0 2.036853 0.033326 0.007022 0.676865
6 4.000000 1.000000 20.0 0.977021 0.058728 0.001813 0.990724
7 4.000000 1.000000 20.0 2.257035 0.061204 0.007720 0.816803
8 4.000000 1.000000 20.0 0.484916 0.048700 0.001620 0.986696
9 4.000000 1.000000 20.0 2.547141 0.052887 0.003677 0.935980
10 4.000000 1.000000 20.0 1.865010 0.057868 0.009088 0.471061
11 4.000000 1.000000 20.0 0.125037 0.048281 0.006071 0.768513
12 1.545455 1.000000 20.0 2.483997 0.036234 0.012994 0.312070
13 1.545455 1.000000 20.0 2.713912 0.050843 0.015150 0.252104
14 1.545455 1.000000 20.0 2.740432 0.054430 0.015246 0.315840
15 1.000000 5.000000 20.0 1.932250 0.010229 0.012775 -0.077052
16 1.000000 5.000000 20.0 2.180274 0.022834 0.009380 0.284250
17 1.000000 5.000000 20.0 1.984917 0.016148 0.010116 0.165649
18 2.636364 3.181818 20.0 -1.569767 0.049392 0.004332 0.998290
19 2.636364 3.181818 20.0 -0.683843 0.049637 0.031566 0.160381
20 2.636364 3.181818 20.0 -0.300910 0.051674 0.026682 0.079612
21 2.636364 5.000000 29.0 2.824726 0.048840 0.003134 0.885150
22 2.636364 5.000000 29.0 2.779152 0.050375 0.011771 0.335623
23 2.636364 5.000000 29.0 2.352918 0.047634 0.009516 0.314454
24 2.636364 5.000000 29.0 3.372817 0.074971 0.007911 0.837700
25 2.636364 5.000000 29.0 3.093418 0.073908 0.010997 0.765327
26 2.636364 5.000000 29.0 3.089719 0.073567 0.009030 0.745127
27 1.000000 2.818182 29.0 2.759980 0.053463 0.018398 0.117035
28 1.000000 2.818182 29.0 2.895809 0.066171 0.020328 -0.085152
29 1.000000 2.818182 29.0 3.016501 0.066801 0.020774 -0.128463
30 1.000000 2.818182 29.0 2.403532 0.077447 0.002035 0.972183
31 1.000000 2.818182 29.0 2.438965 0.079011 0.001350 0.988732
32 1.000000 2.818182 29.0 2.441895 0.078780 0.002889 0.967037
33 1.000000 5.000000 40.0 2.911388 0.071689 0.009754 0.382532
34 1.000000 5.000000 40.0 3.082599 0.069612 0.010115 0.392385
35 1.000000 5.000000 40.0 3.094629 0.069797 0.011311 0.333080
36 1.000000 1.000000 40.0 1.468051 0.115580 0.004583 0.977210
37 1.000000 1.000000 40.0 3.741961 0.126283 0.002852 0.991068
38 1.000000 1.000000 40.0 3.486001 0.119758 0.002842 0.988892
39 4.000000 5.000000 40.0 1.446555 0.110717 0.004600 0.978295
40 4.000000 5.000000 40.0 1.523311 0.108327 0.004352 0.982013
41 4.000000 5.000000 40.0 1.123542 0.098365 0.003310 0.987439
42 1.000000 5.000000 40.0 3.162315 0.075010 0.027382 0.089503
43 1.000000 5.000000 40.0 3.152601 0.072772 0.024214 0.037659
44 1.000000 5.000000 40.0 3.102813 0.070091 0.027736 0.106447
45 1.000000 1.000000 40.0 2.310959 0.031861 0.027076 0.113705
46 1.000000 1.000000 40.0 2.298626 0.031986 0.022425 0.171065
47 1.000000 1.000000 40.0 2.260342 0.028294 0.024612 0.071522
48 4.000000 1.000000 40.0 0.035702 0.110071 0.004118 0.972540
49 4.000000 1.000000 40.0 0.024896 0.108735 0.003161 0.974311
50 4.000000 1.000000 40.0 0.180984 0.099658 0.005794 0.873542
51 4.000000 1.000000 40.0 0.970282 0.103618 0.003518 0.980284
52 4.000000 1.000000 40.0 0.448479 0.091980 0.003289 0.987029
53 4.000000 1.000000 40.0 0.963389 0.099711 0.003788 0.983885
InĀ [2]:
Rep1_NoShake =  pd.DataFrame([],columns = [ 'K','percentDMSO', 'Vol','km', 'vmax', 'loss', 'r_squared'])
Rep1_Shake =  pd.DataFrame([],columns = [ 'K','percentDMSO', 'Vol','km', 'vmax', 'loss', 'r_squared'])

for i in tqdm(range(1,19)):
    Rep1_NoShake=Rep1_NoShake.append(dataset_0.CalculateMetrics(i))
    Rep1_Shake=Rep1_Shake.append(dataset_1.CalculateMetrics(i))
    
Rep1_NoShake.reset_index(inplace=True,drop=True)
Rep1_Shake.reset_index(inplace=True,drop=True)

MixingDifference = Rep1_Shake['r_squared'] - Rep1_NoShake['r_squared']
MixingDifference.name = 'Difference in R sq'

pd.concat([Rep1_Shake[['K','percentDMSO','Vol']],MixingDifference],axis=1)
100%|ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆ| 18/18 [00:26<00:00,  1.56s/it]
Out[2]:
K percentDMSO Vol Difference in R sq
0 1.000000 5.000000 20.0 0.068145
1 2.636364 3.181818 20.0 0.229469
2 4.000000 1.000000 20.0 0.063834
3 4.000000 1.000000 20.0 0.034579
4 1.545455 1.000000 20.0 0.056007
5 1.000000 5.000000 20.0 -0.032856
6 2.636364 3.181818 20.0 1.009708
7 2.636364 5.000000 29.0 -0.001880
8 2.636364 5.000000 29.0 0.053933
9 1.000000 2.818182 29.0 -0.083629
10 1.000000 2.818182 29.0 -0.001108
11 1.000000 5.000000 40.0 -0.017544
12 1.000000 1.000000 40.0 -0.001960
13 4.000000 5.000000 40.0 -0.003488
14 1.000000 5.000000 40.0 -0.012591
15 1.000000 1.000000 40.0 -0.004671
16 4.000000 1.000000 40.0 0.007028
17 4.000000 1.000000 40.0 -0.003935
InĀ [2]:
for i in range(1,19):
    print('Rep 1')
    dataset_1.PlotFigure(i)
    print('Rep 2')
    dataset_2.PlotFigure(i)
    print('Rep 3')
    dataset_3.PlotFigure(i)
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 1
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 2
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
Rep 3
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
InĀ [Ā ]:
from sklearn.decomposition import PCA

pca = PCA(n_components=2)

decomp = pca.fit_transform(dataset_3.data)

plt.scatter(decomp[:,0],decomp[:,1])
plt.show()
InĀ [13]:
plt.figure(figsize=(20,5))
for i in dataset_1.data.index:
    plt.plot(dataset_1.data.loc[i,:],alpha = 0.2)
plt.xticks(range(220,800,10))
plt.ylim((0,0.5))
plt.xlim(300,800)
plt.show()
No description has been provided for this image
InĀ [6]:
dataset_1
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-6-7f6531e28fd8> in <module>
----> 1 dataset_1.Diff(data)

AttributeError: 'PlateDataset' object has no attribute 'Diff'